package rus.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table
public class Shop implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3427756503321033959L;
	
	private Integer id;
	private String name;
	private String URL;
	private ContentImage logo;
	private String description;
	private List<Product> productList;
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getId() {
		return id;
	}
	
	@Column(name="name")
	public String getName() {
		return name;
	}
	@Column(name="url",nullable=false,length=500)
	public String getURL() {
		return URL;
	}
	
	@OneToOne
	@JoinColumn(nullable=true)
	public ContentImage getLogo() {
		return logo;
	}
	
	@Column(name="description")
	public String getDescription() {
		return description;
	}
	
	@ManyToMany
	@JoinColumn(name="product_list")
	public List<Product> getProductList() {
		return productList;
	}

	
	public void setId(Integer id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setURL(String url) {
		URL = url;
	}
	public void setLogo(ContentImage logo) {
		this.logo = logo;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}
}
